
#ifndef _PATH_COMPONENT_H
#define _PATH_COMPONENT_H


#include <SFML/Graphics.hpp>
#include <Box2D\Box2D.h>
#include <angelscript.h>
#include <iostream>
#include <vector>




class PathComponent
{
public:

	PathComponent(void);
	//~PathComponent(void);
	static bool Register_With_ScriptEngine(asIScriptEngine *);
	
	//grab the next path in the array
	// void SetNextNode();
	 b2Vec2 GetTarget();

	 void SetTargetNode(int);
	 int  GetTargetNode();

	 b2Vec2 GetNodePosition(int);
	 
	 void NextTarget();

	 int GetLastNode();
	 
	// void SetTarget(const b2Vec2 &);

//Find Path
	 int FindPath( const b2Vec2 &, const b2Vec2 &);


	 static b2Vec2 GetGridSize();
	 static void SetGridSize(const b2Vec2 &);
	 
	 std::vector<void*> path;


	 //Temporary
	std::vector<sf::Shape> pathShown;

private:

	 b2Vec2 target_pos;
	 int current_node;
	 int last_node;

	 int target_timer;


	 static b2Vec2 grid_size;
	 
protected:

	 //GC stuff
	 void AddRef();
	 void Release();
	int refCount;
};

#endif